// TOWN DIALOGUE SCRIPT
//    Town 162: Greendale

begintalkscript;

variables;

short i,j,k,r1,choice;


begintalknode;
	tag = 1;
	state = -1;
	nextstate = -1;
	condition = 1;
	text1 = "Though you are foreigners, the soldiers recognize you as fellow warriors against the scourges attacking Valorim. They welcome you to rest by their fire and share a meal.";
	text2 = "They tell you about the golems. The constructs are deadly and relentless. Only General Baziron of Tevrono has any luck holding them back.";
	text3 = "They are drunk, celebrating their apparent victory over the golems. They are roaming the woods, hunting down the newly-helpless golems and smashing them. Then they plan to go to Tinraya and reclaim the province from the alien beasts.";
	code = 
		if (gf(308,0) == 0)
			rs(3);
			else rs(2);
	break;


// Maertok 10300

// McElton

begintalknode;
	tag = 60;
	state = -1;
	nextstate = 29;
	question = "McElton";
	text1 = "This wizard is truly ancient. You're almost afraid some part is going to fall off of him while he talks to you. _I am McElton. The wizard. Welcome, youngling._";
	text5 = "McElton watches you. He occasionally makes a raspy, wheezing noise. _Care to see my wares?_";
	action = INTRO;

begintalknode;
	state = 29;
	nextstate = 30;
	question = "_What sort of work do you do?_";
	text1 = "He grunts and says angrily, _I make magic items. Same as I've done for fifty years. And if you came to get me to leave, it ain't gonna' work!_";
	text3 = "He grunts, and says angrily, _I make magic items. Nothing you Anama idiots would appreciate. I've done it for fifty years. And if you came to get me to leave, it ain't gonna' work!_";
	code =
		if (has_spec_item(40) == 0)
			remove_string(3);
			else remove_string(1);
	break;

begintalknode;
	state = 30;
	nextstate = -1;
	question = "_Fifty years?_";
	text1 = "_At least! It's a long time to stay in one place, and I'm not leaving, golems or no._";

begintalknode;
	state = 30;
	nextstate = -1;
	question = "_I haven't come to get you to leave._";
	text1 = "_Good to hear it. They're about to abandon my home to those overgrown statues out there, are they? Well, I ain't goin' along with it! This is where I've lived for fifty years, where I've honed my craft, and I'm goin' down with the ship!_";
	text2 = "_Mark my words! Now, you gonna' buy magic items, or just waste my time?_";

begintalknode;
	state = 30;
	nextstate = 31;
	question = "_You make magic items?_";
	text1 = "_That's right! I make 'em. With my own hands. Enchant 'em myself. You gonna' purchase something or just stand there gaping at me?_";

begintalknode;
	state = 31;
	nextstate = 29;
	question = "_I'll look at your wares._";
	text1 = "_Stare away, but don't waste my time. I don't have so much of it left._";

begintalknode;
	state = 31;
	nextstate = 29;
	question = "_I'll just browse._";
	text1 = "_Huh. I thought so. Well, stare away, but don't waste my time. I don't have so much of it left._";
	action = END_TALK;

begintalknode;
	state = 29;
	nextstate = -1;
	question = "_I'll buy some of your items._";
	text1 = "You conclude your business.";
	code =
		begin_shop_mode("McElton's items","McElton is old and eccentric, but his skill is considerable. He has a wide variety of items available, some bartered for, but most crafted by his own hands.",113,5,3);
	break;

begintalknode;
	state = 29;
	nextstate = -1;
	question = "_Can you teach me any magic?_";
	text1 = "He chuckles. _Oh, no, not me. Go find Maertok. He loves teaching adventurers magic. Absolutely loves it._";

begintalknode;
	state = 29;
	nextstate = -1;
	condition = gf(162,10) >= 1;
	question = "_I found a magical machine in a ruin to the west._";
	text1 = "_Oh, that? I was working on something in that shed. Then the golems blew it up. Ignore all that stuff. I don't think it's good for anything._";


begintalknode;
	state = 29;
	nextstate = -1;
	condition = 1;
	question = "_I would like to sell something._";
	text1 = "You conclude your business.";	
	code = 
		begin_sell_mode();
	break;

begintalknode;
	state = 29;
	nextstate = -1;
	condition = 1;
	question = "_I don't need anything._";
	text1 = "He irritably waves you away.";
	action = END_TALK;